package com.lu.search.controller.v1;

import com.lu.model.common.dtos.ResponseResult;
import com.lu.model.search.dto.ApUserSearchHistoryDto;
import com.lu.search.service.ApUserSearchService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RestController
@RequestMapping("/api/v1/history")
public class ApUserSearchHistoryController {

    @Autowired
    private ApUserSearchService apUserSearchService;


    @PostMapping("/load")
    public ResponseResult findSearchHistory() {
        return apUserSearchService.findSearchHistory();
    }

    @PostMapping("/del")
    public ResponseResult removeSearchHistory(@RequestBody ApUserSearchHistoryDto dto) {
        return apUserSearchService.removeSearchHistory(dto);
    }
}
